<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>分类目录</title>
  <link rel="stylesheet" href="/assets/css/iconfont.css">
  <link rel="stylesheet" href="/assets/libs/bootstrap.min.css">
  <link rel="stylesheet" href="/assets/css/base.css">
  <link rel="stylesheet" href="/assets/css/ad-public.css">
  <link rel="stylesheet" href="/assets/css/ad-public.css">
  <link rel="stylesheet" href="/assets/css/categories.css">

</head>

<body>

  <!-- 侧边栏 -->
  @@include('../assets/common/admin/adminNav.html')


  <!-- 主体 -->
  <div class="main">
    <!-- 头部 -->
    @@include('../assets/common/admin/adminMainHeader.html')
    <!-- 内容区 -->
    <div class="content">
      <div class="page-title">
        <h3>分类目录</h3>
      </div>

      <div class="row">
        <div class="col-md-4 handleForm">
          <form class="addForm">
            <h4>添加分类</h4>
            <div class="form-group">
              <label>名称</label>
              <input class="form-control" name="title" type="text" placeholder="请输入分类名称">
            </div>
            <div class="form-group">
              <label>图标</label>
              <input class="form-control" name="className" type="text" placeholder="请输入分类图标类名">
            </div>
            <div class="form-group">
              <button class="btn btn-primary" type="submit">添加</button>
            </div>
          </form>
        </div>
        <div class="col-md-8">
          <table class="table table-striped table-bordered table-hover">
            <thead>
              <tr>
                <th class="text-center" width="40"><input type="checkbox"></th>
                <th>名称</th>
                <th class="text-center" width="100">操作</th>
              </tr>
            </thead>
            <tbody class="cate">

            </tbody>
          </table>
        </div>
      </div>


    </div>
  </div>

  <!-- 删除模态框 -->
  <div class="modul hide">
    <div class="mosk"></div>
    <div class="content">
      <div class="item">
        <h3>确定要删除吗？</h3>
      </div>
      <div class="btn">
        <a href="javascript:;" class="delete">删除</a>
        <a href="javascript:;" class="cancel">取消</a>
      </div>
    </div>
  </div>

  @@include('../assets/common/adminBase.html')

  <!-- 数据模板 -->
  <script type="text/template" id="dataTempalte">
    {{each result}}

    <tr>
      <td class="text-center"><input type="checkbox"></td>
      <td>{{$value.title}}</td>
      <td class="text-center handel">
        <a href="javascript:;" data-id="{{$value._id}}" class="btn btn-info btn-xs edit">编辑</a>
        <a href="javascript:;" data-id="{{$value._id}}" class="btn btn-danger btn-xs delete-btn">删除</a>
      </td>
    </tr>

    {{/each}}
  </script>

  <!-- 编辑模板 -->
  <script type="text/template" id="editTemplate">
    <form class="editForm">
      <h4>编辑分类</h4>
      <div class="form-group">
        <label>名称</label>
        <input class="form-control" name="title" value="{{result.title}}" type="text" placeholder="请输入分类名称">
      </div>
      <div class="form-group">
        <label>图标</label>
        <input class="form-control" name="className" value="{{result.className}}" type="text" placeholder="请输入分类图标类名">
      </div>
      <div class="form-group">
        <button class="btn btn-primary" type="submit">修改</button>
      </div>
    </form>
  </script>

  <script src="../js/admin/cate.js"></script>

</body>

</html>